package a.i;

import a.c.q;

import java.util.Comparator;
import java.util.Iterator;

public class lb
{
  private final b_ a = this.c = new b_();
  private final b_ b = this.d = new b_();
  private b_ c;
  private b_ d;
  private int e;
  private Comparator f;
  private int g;
  private wb h = new wb(42L);
  private static final boolean i = false;
  public static boolean j;
  
  public lb(Comparator paramComparator)
  {
    this.a.a = this.b;
    this.b.b = this.a;
    this.f = paramComparator;
    this.g = 0;
    this.e = 1;
  }
  
  public lb()
  {
    this(l.a());
  }
  
  public b_ a(Object paramObject)
  {
    boolean bool2 = p.b;
    boolean bool1 = p.a;
    int k = a();
    b_ localb_1;
    int m;
    Object localObject1;
    do
    {
      for (localb_1 = this.c; !bool1; localb_1 = localb_1.a) {
        if (a(paramObject, localb_1.a) <= 0) {
          break;
        }
      }
      m = this.e;
      localObject1 = null;
    } while (bool2);
    Object localObject2 = null;
    label64:
    b_ localb_2;
    do
    {
      if (this.e >= k) {
        break;
      }
      break;
      localb_2 = new b_();
      localb_2.g = paramObject;
      b_ localb_3 = new b_();
      b_ localb_4 = new b_();
      localb_3.e = this.c;
      this.c.d = localb_3;
      this.c = localb_3;
      localb_4.e = this.d;
      this.d.d = localb_4;
      this.d = localb_4;
      localb_3.a = (localb_4.b = localb_2);
      localb_2.b = localb_3;
      localb_2.a = localb_4;
      if (bool1) {
        break label345;
      }
      if (localObject2 != null)
      {
        localb_2.e = localObject2;
        localObject2.d = localb_2;
        if (bool2) {
          continue;
        }
        if (!bool1) {}
      }
      else
      {
        localObject1 = localb_2;
      }
      localObject2 = localb_2;
      this.e += 1;
    } while (!bool1);
    label248:
    label251:
    do
    {
      break label248;
      break label251;
      if (bool2) {
        break label64;
      }
      if (m <= k) {
        break label293;
      }
      localb_1 = localb_1.e;
      m--;
      if (a(paramObject, localb_1.a) <= 0) {
        break;
      }
      if ((bool2) || (bool1)) {
        break label305;
      }
      localb_1 = localb_1.a;
    } while ((!bool2) && ((!bool1) && (!bool1)));
    label293:
    label305:
    label345:
    label479:
    while (!bool2)
    {
      localb_2 = new b_();
      localb_2.g = paramObject;
      localb_2.b = localb_1;
      localb_2.a = localb_1.a;
      localb_1.a.b = localb_2;
      localb_1.a = localb_2;
      if (localObject1 != null)
      {
        localb_2.d = localObject1;
        localObject1.e = localb_2;
      }
      localObject1 = localb_2;
      localb_1 = localb_1.e;
      label371:
      if (localb_1 == null)
      {
        this.g += 1;
        if ((bool2) || (q.n))
        {
          if (!bool2) {}
          p.a = !bool1;
        }
        if (bool2) {
          q.o = !q.o;
        }
        return localb_2;
      }
      for (;;)
      {
        if (a(paramObject, localb_1.a) <= 0) {
          break label479;
        }
        localb_1 = localb_1.a;
        if ((!bool2) && (!bool2))
        {
          if (bool1) {
            break label371;
          }
          if (!bool2) {
            if (bool1) {
              break;
            }
          }
        }
      }
    }
  }
  
  private int a()
  {
    boolean bool = p.b;
    int k = 1;
    if (!bool) {
      if (this.h.nextBoolean())
      {
        k++;
        if (bool) {
          break label194;
        }
        if (this.h.nextBoolean())
        {
          k++;
          if (bool) {
            break label194;
          }
          if (this.h.nextBoolean())
          {
            k++;
            if (bool) {
              break label194;
            }
            if (this.h.nextBoolean())
            {
              k++;
              if (bool) {
                break label194;
              }
              if (this.h.nextBoolean())
              {
                k++;
                if (bool) {
                  break label194;
                }
                if (this.h.nextBoolean())
                {
                  k++;
                  if (bool) {
                    break label194;
                  }
                  if (this.h.nextBoolean())
                  {
                    k++;
                    if (bool) {
                      break label194;
                    }
                    if (this.h.nextBoolean())
                    {
                      k++;
                      if (bool) {
                        break label194;
                      }
                      if (this.h.nextBoolean())
                      {
                        k++;
                        if (bool) {
                          break label194;
                        }
                        if (this.h.nextBoolean())
                        {
                          k++;
                          if (bool) {
                            break label194;
                          }
                          if (this.h.nextBoolean()) {
                            k++;
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
    label194:
    return k;
  }
  
  public void a(b_ paramb_1, b_ paramb_2)
  {
    boolean bool2 = p.b;
    boolean bool1 = p.a;
    if (!bool2) {
      if (paramb_1 == paramb_2)
      {
        a(paramb_1);
        if (!bool1) {
          return;
        }
      }
    }
    b_ localb_1 = paramb_1.b;
    b_ localb_2 = paramb_2.a();
    int k = 0;
    label123:
    do
    {
      if (k >= this.e) {
        break;
      }
      localb_1.a = localb_2;
      if (bool2) {
        break label184;
      }
      localb_2.b = localb_1;
      if (bool1) {
        break label182;
      }
      if (k != this.e - 1)
      {
        do
        {
          do
          {
            if (localb_1.d != null) {
              break;
            }
            if (bool2) {
              break label128;
            }
            localb_1 = localb_1.b;
            if (bool1) {
              break label123;
            }
          } while (!bool1);
        } while (bool2);
        localb_1 = localb_1.d;
        do
        {
          do
          {
            if (localb_2.d != null) {
              break;
            }
            localb_2 = localb_2.a;
            if (bool2) {
              break label170;
            }
            if (bool1) {
              break label168;
            }
          } while (!bool1);
        } while (bool2);
        localb_2 = localb_2.d;
      }
      k++;
    } while (!bool1);
    label128:
    label168:
    label170:
    if (!bool2)
    {
      e();
      label182:
      if (paramb_1 != paramb_2) {
        label184:
        paramb_1 = paramb_1.a;
      }
    }
    while (bool2)
    {
      this.g -= 1;
      if ((!bool2) && (bool1)) {
        return;
      }
      if (!bool1) {
        break;
      }
    }
    this.g -= 1;
  }
  
  public b_ a(b_ paramb_, Object paramObject)
  {
    boolean bool = p.b;
    try
    {
      if (!bool) {
        if (paramb_ == null)
        {
          if (!bool) {
            if (this.g == 0)
            {
              localb_ = a(paramObject);
              return localb_;
            }
          }
          localb_ = b(g(), paramObject);
          return localb_;
        }
      }
      b_ localb_ = a(paramObject, paramb_, paramb_.a);
      return localb_;
    }
    finally {}
  }
  
  public b_ b(b_ paramb_, Object paramObject)
  {
    boolean bool = p.b;
    try
    {
      if (!bool) {
        if (paramb_ == null)
        {
          if (!bool) {
            if (this.g == 0)
            {
              localb_ = a(paramObject);
              return localb_;
            }
          }
          localb_ = a(h(), paramObject);
          return localb_;
        }
      }
      b_ localb_ = a(paramObject, paramb_.b, paramb_);
      return localb_;
    }
    finally {}
  }
  
  private b_ a(Object paramObject, b_ paramb_1, b_ paramb_2)
  {
    boolean bool2 = p.b;
    boolean bool1 = p.a;
    int k = a();
    Object localObject1 = null;
    Object localObject2;
    do
    {
      do
      {
        if (this.e >= k) {
          break;
        }
        localObject2 = new b_();
        b_ localb_1 = new b_();
        ((b_)localObject2).e = this.c;
        this.c.d = ((b_)localObject2);
        this.c = ((b_)localObject2);
        localb_1.e = this.d;
        this.d.d = localb_1;
        this.d = localb_1;
        ((b_)localObject2).a = localb_1;
        localb_1.b = ((b_)localObject2);
        this.e += 1;
      } while (!bool1);
      localObject2 = null;
    } while (bool2);
    int m = 0;
    b_ localb_2 = new b_();
    localb_2.g = paramObject;
    localb_2.b = paramb_1;
    localb_2.a = paramb_2;
    paramb_1.a = localb_2;
    paramb_2.b = localb_2;
    if (localObject1 == null)
    {
      if (bool2) {
        break label211;
      }
      localObject2 = localb_2;
      if (bool1) {
        break label209;
      }
      if (bool2) {
        break label230;
      }
      if (!bool1) {
        break label216;
      }
    }
    label209:
    label211:
    label216:
    label230:
    do
    {
      localb_2.e = localObject1;
      localObject1.d = localb_2;
      localObject1 = localb_2;
      m++;
      if (!bool2)
      {
        if (m < k)
        {
          do
          {
            do
            {
              if (paramb_1.d != null) {
                break;
              }
              if (bool2) {
                break label276;
              }
              paramb_1 = paramb_1.b;
              if (bool1) {
                break label272;
              }
            } while (!bool1);
          } while (bool2);
          paramb_1 = paramb_1.d;
          do
          {
            do
            {
              if (paramb_2.d != null) {
                break;
              }
              paramb_2 = paramb_2.a;
              if (bool2) {
                break label311;
              }
              if (bool1) {
                break label309;
              }
            } while (!bool1);
          } while (bool2);
          paramb_2 = paramb_2.d;
          if (!bool1) {
            break;
          }
        }
        this.g += 1;
      }
    } while (bool2);
    label272:
    label276:
    label309:
    label311:
    return localObject2;
  }
  
  private void b() {}
  
  public int c()
  {
    return this.g;
  }
  
  public void a(b_ paramb_)
  {
    boolean bool2 = p.b;
    boolean bool1 = p.a;
    do
    {
      while (!bool1)
      {
        b_ localb_1 = paramb_.b;
        b_ localb_2 = paramb_.a;
        b_ localb_3 = paramb_.d;
        paramb_.b = (paramb_.a = paramb_.e = paramb_.d = null);
        localb_1.a = localb_2;
        localb_2.b = localb_1;
        if (localb_3 == null) {
          break;
        }
        paramb_ = localb_3;
      }
      e();
      this.g -= 1;
    } while (bool2);
  }
  
  private void e()
  {
    boolean bool2 = p.b;
    do
    {
      boolean bool1 = p.a;
      while (!bool1)
      {
        if (this.e <= 1) {
          break;
        }
        if (!bool2)
        {
          if (this.c.a != this.d) {
            break;
          }
          this.d = this.d.e;
          this.c = this.c.e;
        }
        this.d.d = (this.c.d = null);
        this.e -= 1;
      }
    } while (bool2);
  }
  
  public void f()
  {
    this.g = 0;
    this.e = 1;
    this.a.a = this.b;
    this.b.b = this.a;
    this.b.d = (this.a.d = null);
    this.d = this.b;
    this.c = this.a;
  }
  
  public b_ b(b_ paramb_)
  {
    b_ localb_ = paramb_.a;
    if (!p.b) {
      if (localb_.a == null) {
        return null;
      }
    }
    return localb_;
  }
  
  public b_ c(b_ paramb_)
  {
    b_ localb_ = paramb_.b;
    if (!p.b) {
      if (localb_.b == null) {
        return null;
      }
    }
    return localb_;
  }
  
  public b_ g()
  {
    return b(this.a);
  }
  
  public b_ h()
  {
    return c(this.b);
  }
  
  public Iterator i()
  {
    return new a_(this.a);
  }
  
  public b_ b(Object paramObject)
  {
    boolean bool2 = p.b;
    boolean bool1 = p.a;
    b_ localb_ = this.c;
    label85:
    label89:
    label90:
    for (;;)
    {
      if (a(paramObject, localb_.a) > 0)
      {
        localb_ = localb_.a;
        if (!bool2)
        {
          if ((!bool2) && (bool1)) {
            break label90;
          }
          if (bool2) {
            continue;
          }
          if (!bool1) {
            continue;
          }
        }
      }
      else
      {
        if (bool2) {
          break label89;
        }
        if (localb_.e != null) {
          break label85;
        }
      }
      if (a(paramObject, localb_.a) == 0) {
        return localb_.a;
      }
      return null;
      localb_ = localb_.e;
    }
  }
  
  public b_ c(Object paramObject)
  {
    boolean bool2 = p.b;
    boolean bool1 = p.a;
    b_ localb_ = this.c;
    label100:
    label101:
    for (;;)
    {
      if (a(paramObject, localb_.a) > 0)
      {
        localb_ = localb_.a;
        if (!bool2)
        {
          if ((!bool2) && (bool1)) {
            break label101;
          }
          if (bool2) {
            continue;
          }
          if (!bool1) {
            continue;
          }
        }
      }
      else
      {
        if (bool2) {
          break label100;
        }
        if (localb_.e == null)
        {
          if ((bool2) || (localb_.a != null)) {
            if (bool2) {}
          }
          return localb_.b != null ? localb_ : null;
        }
      }
      localb_ = localb_.e;
    }
  }
  
  public b_ d(Object paramObject)
  {
    boolean bool2 = p.b;
    boolean bool1 = p.a;
    b_ localb_ = this.d;
    label100:
    label101:
    for (;;)
    {
      if (a(paramObject, localb_.b) < 0)
      {
        localb_ = localb_.b;
        if (!bool2)
        {
          if ((!bool2) && (bool1)) {
            break label101;
          }
          if (bool2) {
            continue;
          }
          if (!bool1) {
            continue;
          }
        }
      }
      else
      {
        if (bool2) {
          break label100;
        }
        if (localb_.e == null)
        {
          if ((bool2) || (localb_.a != null)) {
            if (bool2) {}
          }
          return localb_.b != null ? localb_ : null;
        }
      }
      localb_ = localb_.e;
    }
  }
  
  private int a(Object paramObject, b_ paramb_)
  {
    if (!p.b) {
      if (paramb_.b == null) {
        return 1;
      }
    }
    if (paramb_.a == null) {
      return -1;
    }
    return this.f.compare(paramObject, paramb_.g);
  }
  
  public String toString()
  {
    boolean bool2 = p.b;
    boolean bool1 = p.a;
    StringBuffer localStringBuffer = new StringBuffer();
    localStringBuffer.append("SkipList{ size: ");
    localStringBuffer.append(c());
    localStringBuffer.append("; ");
    Iterator localIterator = i();
    if (localIterator.hasNext()) {}
    while (bool2)
    {
      Object localObject = localIterator.next();
      if (bool2) {
        break label101;
      }
      localStringBuffer.append(localObject).append(", ");
      if (bool1) {
        break label100;
      }
      if (!bool1) {
        break;
      }
    }
    localStringBuffer.append("}");
    label100:
    label101:
    return localStringBuffer.toString();
  }
  
  private class a_
    implements Iterator
  {
    private lb.b_ a;
    
    public a_(lb.b_ paramb_)
    {
      this.a = lb.this.b(paramb_);
    }
    
    public boolean hasNext()
    {
      return this.a != null;
    }
    
    public Object next()
    {
      Object localObject = this.a.g;
      this.a = lb.this.b(this.a);
      return localObject;
    }
    
    public void remove()
    {
      lb.this.a(lb.this.c(this.a));
    }
  }
  
  public static class b_
  {
    b_ a;
    b_ b;
    b_ d;
    b_ e;
    Object g;
    public static int h;
    
    public b_ a()
    {
      if (!p.b) {
        if (this.a.a == null) {
          return null;
        }
      }
      return this.a;
    }
    
    public b_ b()
    {
      if (!p.b) {
        if (this.b.b == null) {
          return null;
        }
      }
      return this.b;
    }
    
    public Object c()
    {
      return this.g;
    }
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.i.lb

 * JD-Core Version:    0.7.0.1

 */